/*
 * @Author: szx
 * @Date: 2022-02-28 15:35:30
 * @LastEditTime: 2022-02-28 15:40:10
 * @Description:
 * @FilePath: \leetcode\1100-1199\1128\1128.js
 */
/**
 * @param {number[][]} dominoes
 * @return {number}
 */
var numEquivDominoPairs = function (dominoes) {
    const arr = new Array(100).fill(0);
    let res = 0;
    for (const d of dominoes) {
        const val = d[0] < d[1] ? d[o] * 10 + d[1] : d[1] * 10 + d[0];
        res += arr[val];
        arr[val]++;
    }
    return res;
};
